home *** CD-ROM | disk | FTP | other *** search
/ Gamers Delight 2 / Gamers Delight 2.iso / Aminet / game / role / DebugTool_111.lha / srcfrobnitz.h < prev    next >
C/C++ Source or Header  |  1993-05-06  |  8KB  |  291 lines

  1. /****************************************************************/
  2. /*     Infocom DebugTool                                        */
  3. /*     written in April 1992                                    */
  4. /*     compiled with Aztec-C 5.2a                               */
  5. /*                                                              */
  6. /*        v0.50:  5/ 4/92                                       */
  7. /*        v0.60: 17/ 4/92                                       */
  8. /*        v0.61: 27/ 4/92                                       */
  9. /*        v0.62: 28/ 4/92                                       */
  10. /*        v0.63: 14/ 5/92                                       */
  11. /*        v0.70: 17/ 5/92                                       */
  12. /*        v1.00: 31/ 5/92                                       */
  13. /*        v1.01: 18/ 7/92                                       */
  14. /*        v1.02: 25/ 7/92                                       */
  15. /*        v1.03:  4/ 8/92                                       */
  16. /*        v1.10:  1/11/92                                       */
  17. /*        v1.11:  6/ 5/93                                       */
  18. /*                                                              */
  19. /*     Contact me:                      Paul D. Doherty         */
  20. /*                                      Lindenallee 4           */
  21. /*                                      O-1120 Berlin           */
  22. /*                                      Germany                 */
  23. /*                                                              */
  24. /*     E-mail:  h0142kdd@rz.hu-berlin.de                        */
  25. /*     or       d.doherty@bamp.berlinet.in-berlin.de            */
  26. /****************************************************************/
  27.  
  28.  
  29. /****************************************************************/
  30. /*     DEFINES                                                  */
  31. /****************************************************************/
  32.  
  33. #define VERSTAG "\0$VER: Dave Doherty's Infocom Debugging Tool 1.11 (6.5.93)"
  34. #define STAMP   "Infocom Datafile Debug Tool 1.11"
  35. #define BUGGY   "[That's not a feature - it's a BUG!]"
  36.  
  37. #define MAXLEN_ENCSTR 1024
  38. #define MAXLEN_DECSTR 1024
  39. #define MAXLEN_INFILE 80
  40. #define MAXLEN_MACRO 30
  41. #define MAXLEN_OBJECT 40
  42. #define MAXNUM_OBJECT 650
  43.  
  44. #define NUM_PROPS_OLD 31
  45. #define NUM_PROPS_NEW 63
  46.  
  47.  
  48. /****************************************************************/
  49. /*     INCLUDES                                                 */
  50. /****************************************************************/
  51.  
  52. #include <stdio.h>
  53. #include <stdlib.h>
  54.  
  55.  
  56. /*****************************************************************/
  57. /*     TYPE DEFINITIONS                                          */
  58. /*****************************************************************/
  59.  
  60. typedef unsigned char byte;
  61. typedef unsigned short word;
  62. typedef unsigned short z_word;
  63.  
  64.  
  65. /*****************************************************************/
  66. /*     HEADER STRUCTURE                                          */
  67. /*****************************************************************/
  68.  
  69. struct info_header
  70. {
  71.   byte z_version;
  72.   /*
  73.    * 1,2,3:  ZIP ("standard")
  74.    * 4    : EZIP ("plus")
  75.    * 5    : XZIP ("Solid Gold")
  76.    * 6    : YZIP ("graphics")
  77.    */
  78.   byte zip_flags;
  79.   /*
  80.    * flag 0  0x01  byte swapped game           V3/4
  81.    *               ZIP supports colours        V5+
  82.    * flag 1  0x02  TIME Status Line            V3   (not set == SCORE)
  83.    *               ??                          V4+
  84.    * flag 2  0x04  Maximize data area to 64K   V4+
  85.    * flag 3  0x08  Licensed to Tandy           V3
  86.    *               ZIP supports underlines     V4+
  87.    * flag 4  0x10  ZIP has no status line
  88.    * flag 5  0x20  ZIP supports status window  V3
  89.    * flag 6  0x40  ZIP supports PropFonts (??) V3
  90.    */
  91.   z_word release;
  92.   z_word resident_size;
  93.   z_word game_offset;
  94.   z_word vocab_offset;
  95.   z_word object_offset;
  96.   z_word variable_offset;
  97.   z_word save_area_size;
  98.  
  99.   z_word game_flags;
  100.   /*
  101.    * flag 0  0x01  Scripting is on
  102.    * flag 1  0x02  Use fixed-width fonts       V3
  103.    * flag 2  0x04  Refresh screen after Save/Restore
  104.    * flag 3  0x08  Game has graphics           V5+
  105.    * flag 4  0x10  Game has sound              V3
  106.    *               Game has undo               V5+
  107.    * flag 5  0x20  Game supports mice (??)     V5+
  108.    * flag 6  0x40  Game has colour             V5
  109.    * flag 7  0x80  Game has sound              V5
  110.    * flag 8  0x100 No command line
  111.    */
  112.  
  113.   char rev_date[6];
  114.  
  115.   z_word macro_offset;
  116.   z_word verify_length;
  117.   z_word verify_checksum;
  118.  
  119.   byte zmach_version;
  120.   byte zmach_subversion;
  121.  
  122.   byte screen_rows;
  123.   byte screen_columns;
  124.   byte screen_left;
  125.   byte screen_right;
  126.   byte screen_top;
  127.   byte screen_bottom;
  128.  
  129.   byte max_char_width;
  130.   byte max_char_height;
  131.  
  132.   z_word unknown0;    /* graphix ? */
  133.   z_word unknown1;    /* graphix ? */
  134.   z_word unknown2;    /* COLOURS ? only saved */
  135.   z_word fkey_offset;
  136.   z_word unknown4;    /* not used */
  137.   z_word unknown5;    /* not used */
  138.   z_word alfabet_offset;
  139.   z_word mouse_offset;
  140.  
  141.   char user_name[8];
  142. };
  143.  
  144.  
  145. /*****************************************************************/
  146. /*     GLOBAL VARIABLES                                          */
  147. /*****************************************************************/
  148.  
  149. /*
  150.  *    extern.c
  151.  */
  152.  
  153. extern struct info_header header;
  154.  
  155. extern byte header_level;
  156. extern byte old_header;
  157. extern byte is_savefile;
  158.  
  159. extern byte game_print;
  160. extern byte header_print;
  161. extern byte alphabet_print;
  162. extern byte macros_print;
  163. extern byte object_print;
  164. extern byte tree_print;
  165. extern byte var_print;
  166. extern byte vocab_print;
  167. extern byte do_check;
  168.  
  169. extern char EncodedString[MAXLEN_ENCSTR];
  170. extern char DecodedString[MAXLEN_DECSTR];
  171. extern char MacroString[MAXLEN_MACRO];
  172. extern int PrintedChars;
  173.  
  174. extern byte no_enum;
  175. extern byte no_attr;
  176. extern byte dec_enum;
  177. extern byte no_props;
  178.  
  179. extern FILE *DatFile;
  180. extern char FilStr[MAXLEN_INFILE];
  181.  
  182. extern char alphabet[3][26];
  183. extern short int alph_read;
  184.  
  185. extern char macros[3 * 32][MAXLEN_MACRO];
  186. extern short int macros_read;
  187.  
  188. extern unsigned char object_table[MAXNUM_OBJECT][14];
  189. extern short int objects_read;
  190. extern long objects_count;
  191.  
  192.  
  193. /*****************************************************************/
  194. /*     FUNCTION PROTOTYPES                                       */
  195. /*****************************************************************/
  196.  
  197. /*
  198.  *    alphabet.c
  199.  */
  200.  
  201. void ReadAlphabet (void);
  202. void PrintAlphabet (void);
  203.  
  204. /*
  205.  *    check.c
  206.  */
  207.  
  208. void PerformCheck (void);
  209.  
  210. /*
  211.  *    decode.c
  212.  */
  213.  
  214. void StringDecode (void);
  215. int ExChar (int);
  216. void DecodeReset (void);
  217.  
  218. /*
  219.  *    header.c
  220.  */
  221.  
  222. void ReadHeader (void);
  223. void CheckHeader (void);
  224. void PrintHeader (void);
  225. void HeaderLevel (void);
  226. void IsSavefile (void);
  227. void SwapHeader (void);
  228.  
  229. /*
  230.  *    macros.c
  231.  */
  232.  
  233. void ReadMacros (void);
  234. void PrintMacros (void);
  235. void PrintMacro (int, int);
  236. int MacroLength (int, int);
  237.  
  238. /*
  239.  *    main.c
  240.  */
  241.  
  242. /*
  243.  *    object.c
  244.  */
  245.  
  246. void ReadObjects (void);
  247. void PrintObjects (void);
  248. void PrintObject (int);
  249. void PrintDefProperties (void);
  250. void PrintProperties (int);
  251.  
  252. /*
  253.  *    recog.c
  254.  */
  255.  
  256. int WhichGame (void);
  257. void PrintGame (int);
  258.  
  259. /*
  260.  *    stuffing.c
  261.  */
  262.  
  263. void seek_pos (z_word);
  264. void newline (void);
  265. int power (int, int);
  266. void parse (char *);
  267. void parse_opt (char);
  268. void quit (int);
  269. void error (int);
  270. void helptxt (void);
  271. z_word byteswap (z_word);
  272.  
  273. /*
  274.  *    tree.c
  275.  */
  276.  
  277. void PrintTree (void);
  278. void ChainObj (unsigned long);
  279.  
  280. /*
  281.  *    vars.c
  282.  */
  283.  
  284. void PrintVars (void);
  285.  
  286. /*
  287.  *    vocab.c
  288.  */
  289.  
  290. void PrintVocab (void);
  291.